<%@ page import="cn.edu.hziee.Grade" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: ykd95
  Date: 2022/4/24
  Time: 12:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查询</title>
</head>
<body>
<%
    List<Grade> grades = null;
%>
<c:choose>
    <c:when test="${sessionScope==null}"/>
    <c:otherwise>
        <%
            grades = (List<Grade>) session.getAttribute("find");
        %>
    </c:otherwise>
</c:choose>

<c:url var="update"
       value="UpdateServlet?id="/>
<c:url var="delete"
       value="DeleteServlet?id="/>

<table border="1">
    <tr>
        <td>&nbsp;学号&nbsp;</td>
        <td>&nbsp;姓名&nbsp;</td>
        <td>&nbsp;语文&nbsp;</td>
        <td>&nbsp;数学&nbsp;</td>
        <td>&nbsp;英语&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>
    <c:forEach var="grade" items="<%=grades%>" >

        <tr>
            <td>${grade.number}</td>
            <td>${grade.name}</td>
            <td>${grade.chinese}</td>
            <td>${grade.math}</td>
            <td>${grade.english}</td>
            <td><a href="${update}${grade.id}">修改</a></td>
            <td><a href="${delete}${grade.id}">删除</a></td>
        </tr>
    </c:forEach>
</table>
<button><a href="score.jsp">返回</a></button>
</body>
</html>
